package com.csaba.connector;

import com.csaba.util.I18N;

/**
 * Using this exception you can directly resolve error messages from property files.
 * Messages are loaded from the same package that the package of the class of the "namespace" object
 * passed in the constructor.
 * <p>Convention: Use the bank instance for namespace object, and put messages files to the *.model packages.
 * 
 * @see com.csaba.util.I18N
 * @author gyenes
 *
 */
@SuppressWarnings( "serial" )
public class I18NServiceException extends ServiceException
{
	public I18NServiceException( final Object namespace, final String message )
	{
		super(I18N.getString(namespace, message), "");
	}

	public I18NServiceException( final Object namespace, final String message, final String nativeMessage,
			final Object... args )
	{
		super(I18N.getString(namespace, message, args), nativeMessage);
	}

	public I18NServiceException( final Object namespace, final String message, final Throwable causedBy,
			final Object... args )
	{
		super(I18N.getString(namespace, message, args), causedBy);
		setNativeMessage(causedBy.getMessage());
	}

}
